package cn.action;

import cn.entity.User;
import cn.service.UserService;
import cn.service.impl.UserServiceImpl;
import com.opensymphony.xwork2.ActionSupport;

import java.util.ArrayList;
import java.util.List;

public class IteratorAction extends ActionSupport {
    private UserService userService = new UserServiceImpl();
    private List<User> list = null;

    public List<User> getList() {
        return list;
    }

    public void setList(List<User> list) {
        this.list = list;
    }

    @Override
    public String execute() throws Exception {
        list = new ArrayList<User>();
        list = userService.findAllUser();
        return SUCCESS;
    }
}
